from django import test
from stream import feeds, utils

class TestCase(test.TestCase):
    def assertTagListEqual(self, expected, actual):
        def process(tag_list):
            if len(tag_list) > 0 and hasattr(tag_list[0], 'name'):
                return map(lambda x: x.name, tag_list)
            else:
                return tag_list

        expected = process(expected)
        actual = process(actual)
        if not utils.unorderedEqual(expected, actual):
            raise AssertionError, repr(expected) + ' != ' + repr(actual)
        return utils.unorderedEqual(expected, actual)
